#include <stdio.h>
#include <mpx_supt.h>
#include <R1.CPP>

PCB findPCB(char[] name)
{
	return *searchPCBbyName(name);
}

void insertPCB(char[] queue, PCB* pcb)
{
	if((queue[0] == 'b') || (queue[0] == 'B'))
	{
		enqueueBlocked(*pcb);
	}
	
	else if((queue[0] == 'r') || (queue[0] == 'R'))
	{
		enqueueReady(*pcb);
	}
	
	else
	{
		printf("Please enter either 'B' or 'R'\n);
	}
}

void removePCB(PCB* pcb)
{
	(*pcb).getState();
	//If statement to find which state the pcb is in
	
	if(//its in the ready queue)
	{
		enqueueReady(*pcb);
	}
	
	else if(//its in blocked queue)
	{
		enqueueBlocked(*pcb);
	}
	
	else if(//in suspended state)
	{
		printf("Cannot remove this PCB, PCB is suspended.\n");
	}
}